export default {
	//common
	//保存登录状态
	setLoginStatus(state, isLogin) {
		state.isLogin = isLogin
	},
	//保存用户信息
	setUser(state, userinfo) {
		if (state.isLogin) {
			state.user = userinfo
		} else {
			state.user = {
				icon: "@/static/uni-center/defaultAvatarUrl.png",
				id: "",
				name: "未登录",
				password: "",
				type: "guest",
			}
		}
	},
	//保存当前游戏编号
	setCurrentGameID(state, gameCode) {
		state.currentGameID = gameCode
	},
	//更新游戏进度
	setGameStatus(state, status) {
		state.gameStatus = status
	},
	//保存本轮进行中游戏的当前回合
	setGameStageCode(state, gameStage) {
		state.gameStageCode = gameStage
	},
	//保存角色英文信息 
	setCurrentGameRoleList(state, gameRoleList) {
		state.currentGameRoleList = Object.assign([], gameRoleList)
	},
	//共用组件seat选中的座位号
	setCurrentChoiceSeatNum(state, selectedSeatNum) {
		state.currentChoiceSeatNum = selectedSeatNum
	},
	//保存当前游戏的座位信息(组件处理)
	setCurrentSeatList(state, seatList) {
		state.currentChoiceSeatNum = Object.assign([], seatList)
	},
	//保存当前游戏的基础信息
	setCurrentGameDTO(state, DTO) {
		state.currentGameDTO = Object.assign({}, DTO)
	},
	//保存本轮进行中游戏所有回合的行为信息(角色行为、投票限制/记录/结果)
	setGameStageInfoMap(state,stageInfoMap){
		state.stageInfoMap = Object.assign({}, stageInfoMap)
	},
	// //保存本轮进行中游戏所有回合的投票情况
	// setGameStageVoteRecord(state, gameStageVoteRecord) {
	// 	state.gameStageVoteRecord = Object.assign([], gameStageVoteRecord)
	// },
	// //保存本轮进行中游戏所有回合的投票结果 包含同票情况状态，控制多轮投票
	// setVoteResult(state, voteResult) {
	// 	state.gameStageVoteResult = Object.assign({}, voteResult)
	// },
	// //保存查询游戏的游戏结果
	// setGameResult(state, gameResult) {
	// 	state.gameResult = gameResult
	// },
	//保存查询游戏的游戏得分情况
	setPlayerScoreMap(state, scoreMap) {
		state.playerScoreMap = Object.assign({}, scoreMap)
	},
	//保存存活玩家的座位号
	setAlivePlayerNum(state, aliveSeatNum) {
		state.alivePlayerNum = aliveSeatNum
	},
	//保存查询游戏的赢家信息
	// setgameWinner(state,winner){
	// 	state.winner = winner
	// },

	//dm
	//保存本轮进行中游戏当前回合的玩家行为
	setGameStageAction(state, stageAction) {
		state.gameStageAction = Object.assign([], stageAction)
	},
	//保存角色中文信息 用于生成主持人提交列表、玩家录入信息列表
	setCurrentGameRoleListConfirm(state, gameRoleListConfirm) {
		state.currentGameRoleListConfirm = Object.assign([], gameRoleListConfirm)
	},
	//创建角色的参数列表
	setCurrentGameRoleParams(state, gameRoleParams) {
		state.currentGameRoleParams = Object.assign([], gameRoleParams)
	},
	//汇总本轮进行中回合玩家的行为
	setGameStageActionList(state, stageActionList) {
		state.gameStageActionList = Object.assign([], stageActionList)
	},
	//更新本轮进行中回合的投票状态
	setGameStageVoteStatus(state, voteStatus) {
		state.gameStageVoteStatus = voteStatus
	},
	setPoliceNum(state,policeNum){
		state.policeNum = policeNum
	},

	//player
	//保存玩家座位
	setUserSeatNum(state, gamePlayerSeatNum) {
		state.currentGamePlayerSeatNum = gamePlayerSeatNum
	},
	//保存玩家录入身份
	setUserRole(state, currentChoiceRole) {
		state.currentChoiceRole = currentChoiceRole
	},
	//保存本轮进行中游戏当前回合允许投票/被投票玩家的信息
	setGameStageVoteLimit(state, gameStageVoteLimit) {
		state.gameStageVoteLimit = Object.assign([], gameStageVoteLimit)
	},



}
